/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.openbookformat.obffinder;

import java.util.ArrayList;
import org.openide.cookies.EditorCookie;

/**
 *
 * @author MUFEED
 */
public class FindResult {
    private boolean selected;
    private EditorCookie editorCookie;
    private int index;
    private String find;
    private String replace;
    private boolean errorFlag;
    private ArrayList<String> variables;


    public FindResult(EditorCookie editorCookie, int index, boolean selected, String find, String replace) {
        this.editorCookie = editorCookie;
        this.index = index;
        this.selected = selected;
        this.find = find;
        this.replace = replace;
        variables = new ArrayList<String>();
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getFind() {
        return find;
    }

    public void setFind(String find) {
        this.find = find;
    }

    public String getReplace() {
        return replace;
    }

    public void setReplace(String replace) {
        this.replace = replace;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public EditorCookie getEditorCookie() {
        return editorCookie;
    }

    public void setEditorCookie(EditorCookie editorCookie) {
        this.editorCookie = editorCookie;
    }

    public String toString() {
        return "[" + index + ";" + selected + ";" + find + ";"
                + replace + ";" + errorFlag + "]";
    }

    public boolean isErrorFlag() {
        return errorFlag;
    }

    public void setErrorFlag(boolean errorFlag) {
        this.errorFlag = errorFlag;
    }
    
    public int getVariableCount() {
        return variables.size();
    }
    
    public void addVariable(String var) {
        variables.add(var);
    }
    
    public String getVariable(int idx) {
        return variables.get(idx);
    }

}
